package com.mingqijia.gassafety.webserver.request.cmp.notify;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.List;

/**
 * 数据上报请求
 *
 * @author zhufeng
 * @since 2022/8/1
 */
@Data
@ApiModel("数据上报请求")
public class DataReportRequest {

    @ApiModelProperty(value = "deviceCode")
    @NotEmpty(message = "deviceCode不能为空")
    private String deviceCode;

    @ApiModelProperty(value = "reportDate")
    @NotNull(message = "reportDate不能为空")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date reportDate;

    @ApiModelProperty(value = "signal")
    private Integer signal;

    @ApiModelProperty(value = "powerMode")
    private Integer powerMode;

    @ApiModelProperty(value = "electricQuantity")
    private Integer electricQuantity;

    @ApiModelProperty(value = "detectorNum")
    @NotNull(message = "detectorNum不能为空")
    private Integer detectorNum;

    @ApiModelProperty(value = "workStatus")
    private Integer workStatus;

    @ApiModelProperty(value = "controllerStatus")
    private Integer controllerStatus;

    @ApiModelProperty(value = "valveControl")
    private Integer valveControl;

    @ApiModelProperty(value = "data")
    private List<DataReportDataRequest> data;

    private Integer recordType;

    //报警器累计工作天数
    private Integer workingDays;
    //电磁阀设备连接，0表示未连接，1表示已连接，其他数字代表电磁阀ID且已连接
    private Integer valveConnection;
    //电磁阀工作状态，0正常，1故障
    private Integer valveWorkStatus;
    //电磁阀门状态，0开，1关
    private Integer valveStatus;
    //电磁阀状态描述，多个状态以英文“;”分隔，具体参见字典定义
    private String valveStatusDesc;
    //时钟准确度 0:较高 1:高 2:中 3:低
    private Integer clockAccuracy;
}
